﻿<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="admin/lib/html5shiv.js"></script>
	<script type="text/javascript" src="admin/lib/respond.min.js"></script>
	<![endif]-->
	<link rel="stylesheet" type="text/css" href="admin/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="admin/lib/Hui-iconfont/1.0.9/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="admin/static/business/css/style.css" />
	<!--[if IE 6]>
	<script type="text/javascript" src="admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
	<title>我的桌面</title>
	<style>
		.inline{
			display: inline-block;
		}
		.title{
			font-size: 20px;
			text-align: left;
		}
		.img-wrapper{
			vertical-align: bottom;
			width: 100px;
			height:90px;
		}
	</style>
	</head>
<body>
	<div class="wap-container">
		<article class="Hui-admin-content clearfix">
			<div class="row-24 clearfix" style="margin-left: -12px; margin-right: -12px;">
				<div class="col-24-xs-24 col-24-sm-12 col-24-md-12 col-24-lg-12 col-24-xl-6" style="padding-left: 12px; padding-right: 12px; margin-bottom: 24px;">
					<div class="panel" id="stat_order">
						<div class="panel-header" style="padding:15px 24px;font-weight: 400;color:#999;">本月业绩：</div>
						<div class="panel-body" style="padding:0 24px;">
							<div class="c-primary" style="font-size: 30px;line-height: 38px;padding-bottom: 24px;">
								&yen; 0
							</div>
							<div class="f-14" style="padding: 10px 0;border-top:solid 1px #eee"><span class="c-999">总业绩：</span> <span>&yen; 0</span></div>
						</div>
					</div>
				</div>
				<div class="col-24-xs-24 col-24-sm-12 col-24-md-12 col-24-lg-12 col-24-xl-6" style="padding-left: 12px; padding-right: 12px; margin-bottom: 24px;">
					<div class="panel" id="stat_medium">
						<div class="panel-header" style="padding:15px 24px;font-weight: 400;color:#999;">本月新增公众号：</div>
						<div class="panel-body" style="padding:0 24px;">
							<div class="c-success" style="font-size: 30px;line-height: 38px;padding-bottom: 24px;">
								0
							</div>
							<div class="f-14" style="padding: 10px 0;border-top:solid 1px #eee"><span class="c-999">总公众号：</span> <span>0</span></div>
						</div>
					</div>
				</div>
				<div class="col-24-xs-24 col-24-sm-12 col-24-md-12 col-24-lg-12 col-24-xl-6" style="padding-left: 12px; padding-right: 12px; margin-bottom: 24px;">
					<div class="panel" id="stat_payment">
						<div class="panel-header" style="padding:15px 24px;font-weight: 400;color:#999;">待付款金额：</div>
						<div class="panel-body" style="padding:0 24px;">
							<div class="c-danger" style="font-size: 30px;line-height: 38px;padding-bottom: 24px;">
                                &yen; 0
							</div>
							<div class="f-14" style="padding: 10px 0;border-top:solid 1px #eee"><span class="c-999">已付款金额：</span> <span>&yen; 0</span></div>
						</div>
					</div>
				</div>
				<div class="col-24-xs-24 col-24-sm-12 col-24-md-12 col-24-lg-12 col-24-xl-6" style="padding-left: 12px; padding-right: 12px; margin-bottom: 24px;">
					<div class="panel" id="stat_receipt">
						<div class="panel-header" style="padding:15px 24px;font-weight: 400;color:#999;">待回款金额：</div>
						<div class="panel-body" style="padding:0 24px;">
							<div class="c-warning" style="font-size: 30px;line-height: 38px;padding-bottom: 24px;">
                                &yen; 0
							</div>
							<div class="f-14" style="padding: 10px 0;border-top:solid 1px #eee"><span class="c-999">已回款金额：</span> <span>&yen; 0</span></div>
						</div>
					</div>
				</div>
			</div>
			<div class="panel">
				<div class="panel-body">
					<div class="title">
						<div class="img-wrapper inline">
							<img src="admin/images/award.jpg" alt="" width="100%">
						</div>
						<span class="f-20 inline">本月销售业绩排行榜（按照投放日期统计）</span>
					</div>
					<table class="table table-border table-bordered table-bg mt-20">
						<thead>
							<tr>
								<th width="15%">排名</th>
								<th width="30%">姓名</th>
								<th width="25%">排期数量</th>
								<th width="30%">业绩</th>
							</tr>
						</thead>
						<tbody id="rankBody">
						</tbody>
					</table>
				</div>
			</div>
		</article>
		<footer class="footer Hui-admin-footer">
		</footer>
	</div>
	<script type="text/javascript" src="admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="admin/lib/layer/3.1.1/layer.js"></script>
	<script type="text/javascript" src="admin/static/h-ui/js/H-ui.min.js"></script>

	<script type="text/javascript" src="admin/js/common.js"></script>
	<script type="text/javascript" src="admin/js/formatter.js"></script>
	<script type="text/javascript" src="admin/js/sockjs.min.js"></script>
	<script type="text/javascript" src="admin/js/stomp.min.js"></script>
</body>
<script type="text/javascript">
    var role_type = sessionStorage.getItem("role_type");
	$(function () {
        getStatInfo();
        getRankList();
    });

    //获取系统统计信息
	function getStatInfo() {
        ajaxGetFun("order/getStatInfo", {}, function(bizData) {
            if (role_type == "XSB" || role_type == "MJB") {
                $("#stat_order .panel-header").html("我的本月业绩：");
                $("#stat_order .panel-body .f-14").html('<span class="c-999">我的总业绩：</span> <span>&yen; '+ bizData.totalOrderProfit +'</span>');
            } else {
                $("#stat_order .panel-header").html("本月业绩：");
                $("#stat_order .panel-body .f-14").html('<span class="c-999">总业绩：</span> <span>&yen; '+ bizData.totalOrderProfit +'</span>');
            }
            $("#stat_order .panel-body .c-primary").html("&yen; "+ bizData.monthOrderProfit);
            $("#stat_medium .panel-body .c-success").html(bizData.monthMediumCount);
            $("#stat_medium .panel-body .f-14").html('<span class="c-999">总公众号：</span> <span>'+ bizData.totalMediumCount +'</span>');
            $("#stat_payment .panel-body .c-danger").html("&yen; "+ bizData.backlogPayMoney);
            $("#stat_payment .panel-body .f-14").html('<span class="c-999">已付款金额：</span> <span>&yen; '+ bizData.processedPayMoney +'</span>');
            $("#stat_receipt .panel-body .c-warning").html("&yen; "+ bizData.backlogRecMoney);
            $("#stat_receipt .panel-body .f-14").html('<span class="c-999">已回款金额：</span> <span>&yen; '+ bizData.processedRecMoney +'</span>');
        }, null, "获取系统统计信息");
    }

    //获取排行榜列表
	function getRankList() {
        ajaxGetFun("order/getRankList", {}, function(bizData) {
            var html = "";
            for(var i = 0; i < bizData.length; i ++){
                var rank = "";
                var order = i + 1;
                if (order === 1) {
                    rank = '<img src="admin/images/1.jpg" width="30">';
                } else if (order === 2) {
                    rank = '<img src="admin/images/2.jpg" width="30">';
                } else if(order === 3) {
                    rank = '<img src="admin/images/3.jpg" width="30">';
                } else {
                    rank = '<b>'+ order +'</b>';
                }
                html += '<tr>' +
                    '<td>' + rank + '</td>' +
                    '<td>' + bizData[i].userName + '</td>' +
                    '<td>' + bizData[i].orderCount +'</td>' +
                    '<td>' + bizData[i].sumProfit +'</td>' +
                    '</tr>';
            }
            $("#rankBody").html(html);
        }, null, "获取排行榜列表");
    }
</script>
</html>
